package at.chl.lution.interpreter;

import at.chl.genetic.function.math.result.MathFunctionResult;
import at.chl.genetic.function.result.IGeneticFunctionResult;

public class MathAccuracyInterpreter implements IAccuracyInterpreter{

	@Override
	public Long interpretAccuracy(IGeneticFunctionResult result,
			IGeneticFunctionResult expectedResult) {
		long resultValue = ((MathFunctionResult)result).getResult();
		long expectedValue = ((MathFunctionResult)expectedResult).getResult();
		long dif;
		
		if(resultValue>expectedValue){
			dif=resultValue-expectedValue;
		}else{
			dif=expectedValue-resultValue;
		}
		return dif;
	}
	
}
